package com.quan.admin.mapper;

import com.quan.admin.entity.SysPermission;
import com.quan.admin.entity.SysRole;
import com.quan.admin.entity.SysUser;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.quan.commons.core.biz.support.MyBaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 系统-用户
 * 
 * @author yhaoquan
 * @email yhaoquan@163.com
 * @date 2020-08-03 20:32:03
 */
public interface SysUserMapper extends MyBaseMapper<SysUser> {

	/**
     * 分页查询列表
     * @param page
     * @param entity
     * @return
     */
    IPage<SysUser> selectMyPage(IPage<SysUser> page, @Param("entity") SysUser entity);

    /**
     * 获取用户的角色
     * @param userId
     * @return
     */
    public List<SysRole> getUserRoles(@Param("userId") Long userId);

    /**
     * 获取用户的权限
     * @param userId
     * @return
     */
    public List<SysPermission> getUserPermissions(@Param("userId") Long userId);

}
